/*
 * SortByDF.h
 *
 *  Created on: Oct 28, 2011
 *      Author: gassa
 */

#ifndef SORTBYDF_H_
#define SORTBYDF_H_

#include "../RetrievalProcessor/IndexLoader.h"

class SortByDF {
	bool reverse;
public:
	virtual ~SortByDF();
	SortByDF(const bool& revparam=false){	reverse=revparam;
	}
	bool operator()(const Term* lhs, const Term* rhs) const {
		if (reverse)
			return (lhs->df > rhs->df);
		else
			return (lhs->df < rhs->df);
	}
};

#endif /* SORTBYDF_H_ */
